import request from '@/config/axios'

// 供应商分类 VO
export interface VendorClassifyVO {
  id: number // id
  code: string // 分类编码
  name: string // 分类名称
  parentId: number // 父ID
}

// 供应商分类 API
export const VendorClassifyApi = {
  // 查询供应商分类列表
  getVendorClassifyList: async (params) => {
    return await request.get({ url: `/wms/vendor-classify/list`, params })
  },

   // 查询供应商分类列表
   getVendorClassifyListAll: async () => {
    return await request.get({ url: `/wms/vendor-classify/list` })
  },

  // 查询供应商分类详情
  getVendorClassify: async (id: number) => {
    return await request.get({ url: `/wms/vendor-classify/get?id=` + id })
  },

  // 新增供应商分类
  createVendorClassify: async (data: VendorClassifyVO) => {
    return await request.post({ url: `/wms/vendor-classify/create`, data })
  },

  // 修改供应商分类
  updateVendorClassify: async (data: VendorClassifyVO) => {
    return await request.put({ url: `/wms/vendor-classify/update`, data })
  },

  // 删除供应商分类
  deleteVendorClassify: async (id: number) => {
    return await request.delete({ url: `/wms/vendor-classify/delete?id=` + id })
  },

  // 导出供应商分类 Excel
  exportVendorClassify: async (params) => {
    return await request.download({ url: `/wms/vendor-classify/export-excel`, params })
  },
}

export function getVendorClassifyListAll(): VendorClassifyVO[] | {
id: number // id
; code: string // 分类编码
; name: string // 分类名称
; parentId: number // 父ID

}[] | PromiseLike<VendorClassifyVO[] | {
id: number // id
; code: string // 分类编码
; name: string // 分类名称
; parentId: number // 父ID

}[]> {
throw new Error('Function not implemented.')
}
